package com.rich.house.service.impl;
import java.util.List;

import com.rich.common.entity.TbInformation;
import com.rich.house.mapper.InformationMapper;
import com.rich.house.service.InformationService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

/**
 * 服务实现层
 * @author Administrator
 *
 */
@Service
public class InformationServiceImpl implements InformationService {

	@Autowired
	private InformationMapper informationMapper;
	
	/**
	 * 查询全部
	 */
	@Override
	public List<TbInformation> findAll() {
		return informationMapper.findAll();
	}

	/**
	 * 增加
	 */
	@Override
	public void add(TbInformation information) {
		informationMapper.insert(information);		
	}

	
	/**
	 * 修改
	 */
	@Override
	public void update(TbInformation information){
		informationMapper.updateById(information);
	}	
	
	/**
	 * 根据ID获取实体
	 * @param id
	 * @return
	 */
	@Override
	public TbInformation findOne(Long id){
		return informationMapper.findById(id);
	}

	/**
	 * 批量删除
	 */
	@Override
	public void delete(Long[] ids) {
		for(Long id:ids){
			informationMapper.deleteById(id);
		}		
	}

	@Override
	public List<TbInformation> secrch(TbInformation information) {
		return informationMapper.search(information);
	}
}
